package com.atguigu.exercise.exer3;

public class BwfOuterClass {
    private int x = 1;
    private int y = 2;
    private class BwfInnerClass{
        private int x = 3;
        public void print(){
            System.out.println("x+y =" +(x+y));
            //当变量重名，遵循就近原则。
        }
    }

    public static void main(String[] args) {
        //匿名对象的概念
        new BwfOuterClass().new BwfInnerClass().print();

        /*BwfOuterClass b1 = new BwfOuterClass();
        BwfInnerClass b2 = b1.new BwfInnerClass();
        b2.print();*/
    }
}
